{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Trigger Joins\n",
    "\n",
    "In this notebook we show use of trigger joins of type \"any\" where we wait for any of the inputs tobe present. We illustrate where we send various combinations of 2 inputs and show we always get an output."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "\n",
    "def get_request_string(use_trigger_1=True, use_trigger_2=True):\n",
    "    request = {\n",
    "        \"model_name\": \"whatever\",\n",
    "        \"inputs\": [\n",
    "            {\"name\": \"INPUT1\", \"contents\": {\"int64Contents\": [1]}, \"datatype\": \"INT64\", \"shape\": [1]},\n",
    "            {\"name\": \"INPUT2\", \"contents\": {\"int64Contents\": [1]}, \"datatype\": \"INT64\", \"shape\": [1]},\n",
    "        ]\n",
    "    }\n",
    "\n",
    "    if use_trigger_1:\n",
    "        request[\"inputs\"].append({\"name\": \"TRIGGER1\", \"contents\": {\"boolContents\": [True]}, \"datatype\": \"BOOL\", \"shape\": [1]})\n",
    "    \n",
    "    if use_trigger_2:\n",
    "        request[\"inputs\"].append({\"name\": \"TRIGGER2\", \"contents\": {\"boolContents\": [True]}, \"datatype\": \"BOOL\", \"shape\": [1]})\n",
    "    \n",
    "    request_string = json.dumps(request)\n",
    "    return request_string"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Load models and pipelines"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\n",
      "{}\n",
      "{}\n"
     ]
    }
   ],
   "source": [
    "!seldon model load -f ./models/id1_node.yaml\n",
    "!seldon model load -f ./models/id2_node.yaml\n",
    "!seldon model load -f ./models/join_node.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\n",
      "{}\n",
      "{}\n"
     ]
    }
   ],
   "source": [
    "!seldon model status join_node -w ModelAvailable\n",
    "!seldon model status id1_node -w ModelAvailable\n",
    "!seldon model status id2_node -w ModelAvailable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline load -f ./pipelines/triggers_join_inputs.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1;39m{\r\n",
      "  \u001b[0m\u001b[34;1m\"pipelineName\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"triggers_join_inputs\"\u001b[0m\u001b[1;39m,\r\n",
      "  \u001b[0m\u001b[34;1m\"versions\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "    \u001b[1;39m{\r\n",
      "      \u001b[0m\u001b[34;1m\"pipeline\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "        \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"triggers_join_inputs\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"uid\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"cg5g8ak6dpcs73c4qhpg\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"version\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m1\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"steps\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "          \u001b[1;39m{\r\n",
      "            \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"join_node\"\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"inputs\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "              \u001b[0;32m\"triggers_join_inputs.inputs.INPUT1\"\u001b[0m\u001b[1;39m,\r\n",
      "              \u001b[0;32m\"triggers_join_inputs.inputs.INPUT2\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"triggers\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "              \u001b[0;32m\"triggers_join_inputs.inputs.TRIGGER1\"\u001b[0m\u001b[1;39m,\r\n",
      "              \u001b[0;32m\"triggers_join_inputs.inputs.TRIGGER2\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"triggersJoin\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"ANY\"\u001b[0m\u001b[1;39m\r\n",
      "          \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "        \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"output\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "          \u001b[0m\u001b[34;1m\"steps\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "            \u001b[0;32m\"join_node.outputs\"\u001b[0m\u001b[1;39m\r\n",
      "          \u001b[1;39m]\u001b[0m\u001b[1;39m\r\n",
      "        \u001b[1;39m}\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"kubernetesMeta\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{}\u001b[0m\u001b[1;39m\r\n",
      "      \u001b[1;39m}\u001b[0m\u001b[1;39m,\r\n",
      "      \u001b[0m\u001b[34;1m\"state\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "        \u001b[0m\u001b[34;1m\"pipelineVersion\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m1\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"status\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"PipelineReady\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"reason\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"created pipeline\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"lastChangeTimestamp\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"2023-03-10T10:19:22.997419447Z\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"modelsReady\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39mtrue\u001b[0m\u001b[1;39m\r\n",
      "      \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "    \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "  \u001b[1;39m]\u001b[0m\u001b[1;39m\r\n",
      "\u001b[1;39m}\u001b[0m\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline status triggers_join_inputs -w PipelineReady | jq ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "apiVersion: mlops.seldon.io/v1alpha1\r\n",
      "kind: Pipeline\r\n",
      "metadata:\r\n",
      "  name: triggers_join_inputs\r\n",
      "spec:\r\n",
      "  steps:\r\n",
      "    - name: join_node\r\n",
      "      inputs:\r\n",
      "        - triggers_join_inputs.inputs.INPUT1\r\n",
      "        - triggers_join_inputs.inputs.INPUT2\r\n",
      "      triggers:\r\n",
      "        - triggers_join_inputs.inputs.TRIGGER1\r\n",
      "        - triggers_join_inputs.inputs.TRIGGER2\r\n",
      "      triggersJoinType: any\r\n",
      "  output:\r\n",
      "    steps:\r\n",
      "      - join_node\r\n"
     ]
    }
   ],
   "source": [
    "!cat ./pipelines/triggers_join_inputs.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"outputs\":[{\"name\":\"OUTPUT1\",\"datatype\":\"INT64\",\"shape\":[\"1\"],\"contents\":{\"int64Contents\":[\"2\"]}}]}\r\n"
     ]
    }
   ],
   "source": [
    "request_string = get_request_string(use_trigger_1=True, use_trigger_2=True)\n",
    "\n",
    "!seldon pipeline infer triggers_join_inputs --inference-mode grpc '{request_string}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"outputs\":[{\"name\":\"OUTPUT1\",\"datatype\":\"INT64\",\"shape\":[\"1\"],\"contents\":{\"int64Contents\":[\"2\"]}}]}\r\n"
     ]
    }
   ],
   "source": [
    "request_string = get_request_string(use_trigger_1=True, use_trigger_2=False)\n",
    "\n",
    "!seldon pipeline infer triggers_join_inputs --inference-mode grpc '{request_string}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"outputs\":[{\"name\":\"OUTPUT1\",\"datatype\":\"INT64\",\"shape\":[\"1\"],\"contents\":{\"int64Contents\":[\"2\"]}}]}\r\n"
     ]
    }
   ],
   "source": [
    "request_string = get_request_string(use_trigger_1=False, use_trigger_2=True)\n",
    "\n",
    "!seldon pipeline infer triggers_join_inputs --inference-mode grpc '{request_string}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline unload triggers_join_inputs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline load -f ./pipelines/triggers_join_internal.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1;39m{\r\n",
      "  \u001b[0m\u001b[34;1m\"pipelineName\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"triggers_join_internal\"\u001b[0m\u001b[1;39m,\r\n",
      "  \u001b[0m\u001b[34;1m\"versions\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "    \u001b[1;39m{\r\n",
      "      \u001b[0m\u001b[34;1m\"pipeline\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "        \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"triggers_join_internal\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"uid\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"cg5g8fs6dpcs73c4qhq0\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"version\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m1\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"steps\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "          \u001b[1;39m{\r\n",
      "            \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"id1_node\"\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"inputs\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "              \u001b[0;32m\"triggers_join_internal.inputs.TRIGGER1\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"tensorMap\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "              \u001b[0m\u001b[34;1m\"triggers_join_internal.inputs.TRIGGER1\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"INPUT1\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "          \u001b[1;39m}\u001b[0m\u001b[1;39m,\r\n",
      "          \u001b[1;39m{\r\n",
      "            \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"id2_node\"\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"inputs\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "              \u001b[0;32m\"triggers_join_internal.inputs.TRIGGER2\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"tensorMap\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "              \u001b[0m\u001b[34;1m\"triggers_join_internal.inputs.TRIGGER2\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"INPUT1\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "          \u001b[1;39m}\u001b[0m\u001b[1;39m,\r\n",
      "          \u001b[1;39m{\r\n",
      "            \u001b[0m\u001b[34;1m\"name\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"join_node\"\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"inputs\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "              \u001b[0;32m\"triggers_join_internal.inputs.INPUT1\"\u001b[0m\u001b[1;39m,\r\n",
      "              \u001b[0;32m\"triggers_join_internal.inputs.INPUT2\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"triggers\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "              \u001b[0;32m\"id1_node.outputs.OUTPUT1\"\u001b[0m\u001b[1;39m,\r\n",
      "              \u001b[0;32m\"id2_node.outputs.OUTPUT1\"\u001b[0m\u001b[1;39m\r\n",
      "            \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "            \u001b[0m\u001b[34;1m\"triggersJoin\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"ANY\"\u001b[0m\u001b[1;39m\r\n",
      "          \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "        \u001b[1;39m]\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"output\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "          \u001b[0m\u001b[34;1m\"steps\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\r\n",
      "            \u001b[0;32m\"join_node.outputs\"\u001b[0m\u001b[1;39m\r\n",
      "          \u001b[1;39m]\u001b[0m\u001b[1;39m\r\n",
      "        \u001b[1;39m}\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"kubernetesMeta\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{}\u001b[0m\u001b[1;39m\r\n",
      "      \u001b[1;39m}\u001b[0m\u001b[1;39m,\r\n",
      "      \u001b[0m\u001b[34;1m\"state\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\r\n",
      "        \u001b[0m\u001b[34;1m\"pipelineVersion\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m1\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"status\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"PipelineReady\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"reason\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"created pipeline\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"lastChangeTimestamp\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"2023-03-10T10:19:43.307156600Z\"\u001b[0m\u001b[1;39m,\r\n",
      "        \u001b[0m\u001b[34;1m\"modelsReady\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39mtrue\u001b[0m\u001b[1;39m\r\n",
      "      \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "    \u001b[1;39m}\u001b[0m\u001b[1;39m\r\n",
      "  \u001b[1;39m]\u001b[0m\u001b[1;39m\r\n",
      "\u001b[1;39m}\u001b[0m\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline status triggers_join_internal -w PipelineReady | jq ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "apiVersion: mlops.seldon.io/v1alpha1\r\n",
      "kind: Pipeline\r\n",
      "metadata:\r\n",
      "  name: triggers_join_internal\r\n",
      "spec:\r\n",
      "  steps:\r\n",
      "    - name: id1_node\r\n",
      "      inputs:\r\n",
      "        - triggers_join_internal.inputs.TRIGGER1\r\n",
      "      tensorMap:\r\n",
      "        triggers_join_internal.inputs.TRIGGER1: INPUT1\r\n",
      "    - name: id2_node\r\n",
      "      inputs:\r\n",
      "        - triggers_join_internal.inputs.TRIGGER2\r\n",
      "      tensorMap:\r\n",
      "        triggers_join_internal.inputs.TRIGGER2: INPUT1\r\n",
      "    - name: join_node\r\n",
      "      inputs:\r\n",
      "        - triggers_join_internal.inputs.INPUT1\r\n",
      "        - triggers_join_internal.inputs.INPUT2\r\n",
      "      triggers:\r\n",
      "        - id1_node.outputs.OUTPUT1\r\n",
      "        - id2_node.outputs.OUTPUT1\r\n",
      "      triggersJoinType: any\r\n",
      "  output:\r\n",
      "    steps:\r\n",
      "      - join_node\r\n"
     ]
    }
   ],
   "source": [
    "!cat ./pipelines/triggers_join_internal.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"outputs\":[{\"name\":\"OUTPUT1\",\"datatype\":\"INT64\",\"shape\":[\"1\"],\"contents\":{\"int64Contents\":[\"2\"]}}]}\r\n"
     ]
    }
   ],
   "source": [
    "request_string = get_request_string(use_trigger_1=True, use_trigger_2=True)\n",
    "\n",
    "!seldon pipeline infer triggers_join_internal --inference-mode grpc '{request_string}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"outputs\":[{\"name\":\"OUTPUT1\",\"datatype\":\"INT64\",\"shape\":[\"1\"],\"contents\":{\"int64Contents\":[\"2\"]}}]}\r\n"
     ]
    }
   ],
   "source": [
    "request_string = get_request_string(use_trigger_1=True, use_trigger_2=False)\n",
    "\n",
    "!seldon pipeline infer triggers_join_internal --inference-mode grpc '{request_string}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"outputs\":[{\"name\":\"OUTPUT1\",\"datatype\":\"INT64\",\"shape\":[\"1\"],\"contents\":{\"int64Contents\":[\"2\"]}}]}\r\n"
     ]
    }
   ],
   "source": [
    "request_string = get_request_string(use_trigger_1=False, use_trigger_2=True)\n",
    "\n",
    "!seldon pipeline infer triggers_join_internal --inference-mode grpc '{request_string}'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline unload triggers_join_internal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\n",
      "{}\n",
      "{}\n"
     ]
    }
   ],
   "source": [
    "!seldon model unload id1_node\n",
    "!seldon model unload id2_node\n",
    "!seldon model unload join_node"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "d5dfeee30c3d1c2ae1f5e8224888e63391d275d607ef34fbb59d48e23cc490af"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
